package com.xie.smfs.registry;

import com.xie.smfs.Smfs;
import com.xie.smfs.block.GhostCoffinBlock;
import com.xie.smfs.block.GoldCoffinBlock;
import com.xie.smfs.block.RedCoffinBlock;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;

public class ModBlocks {
    // 注册鬼棺方块 - 修正：传递正确的Settings
    public static final Block GHOST_COFFIN = register("ghost_coffin",
            new GhostCoffinBlock(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)
                    .nonOpaque()
                    .sounds(BlockSoundGroup.WOOD)));

    public static final Block RED_COFFIN = register("red_coffin",
            new RedCoffinBlock(AbstractBlock.Settings.copy(Blocks.CRIMSON_PLANKS)
                    .nonOpaque()
                    .sounds(BlockSoundGroup.WOOD)));

    public static final Block GOLD_COFFIN = register("gold_coffin",
            new GoldCoffinBlock(AbstractBlock.Settings.copy(Blocks.GOLD_BLOCK)
                    .nonOpaque()
                    .sounds(BlockSoundGroup.METAL)));

    private static Block register(String name, Block block) {
        return Registry.register(Registries.BLOCK, new Identifier(Smfs.MOD_ID, name), block);
    }

    public static void registerBlocks() {
        Smfs.LOGGER.info("Registering Mod Blocks for {}", Smfs.MOD_ID);
    }
}